﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace dotFitness.Domain
{
    public abstract class ScheduleDayBase : EntityBase 
    {
        protected ScheduleDayBase() 
        {
            this.Exercises = new HashSet<ScheduleExercise>();
        }

        protected ScheduleDayBase(int day)
            : this()
        {
            this.Day = day;
        }

        public int Day
        {
            get;
            internal set;
        }

        public string Name
        {
            get;
            set;
        }

        public string Description
        {
            get;
            set;
        }

        public override string ToString()
        {
            return string.Format("Day {0}{1}", this.Day, string.IsNullOrWhiteSpace(this.Name) ? string.Empty : ": " + this.Name);
        }
        
        /// <summary>
        /// Forced to add this to the base class until EF supports eager loading 
        /// polymorphic navigation collection properties.
        /// </summary>
        protected ICollection<ScheduleExercise> Exercises
        {
            get;
            private set;
        }
    }
}
